#include once "mud-gui/ui.bi"
#include once "mud-gui/gclass.bi"
#include once "mud-gui/util.bi"
#include once "mud-gui/event.bi"
#include once "mud-gui/widgets/basewidget.bi"

#inclib "mudgui-stdwidgets"

namespace ui

type stringRow
	as string text
	as integer start, length
end type


gclass(LineEdit)

	declare constructor ( byval parent as BaseWidget ptr = 0, byref _text_ as string = "", byref _placeholder_ as string = "" )
	
	DEF_BYREF_PROPERTY( text, string )
	DEF_BYREF_PROPERTY( placeHolder, string )
	DEF_PROPERTY( editable, ubyte )
	DEF_BPROPERTY( minimumWidth, integer )
	DEF_BPROPERTY( minimumHeight, integer )
	DEF_BPROPERTY( columns, integer )
	DEF_BPROPERTY( rows, integer )
	DEF_PROPERTY( wordwrap, ubyte )
	DEF_PROPERTY( isPassword, ubyte )
	DEF_BYREF_PROPERTY( passwordChar, string )
	DEF_PROPERTY( caret, integer )
	DEF_PROPERTY( caretRow, integer )
	DEF_PROPERTY( caretCol, integer )
	DEF_BYREF_PROPERTY( acceptedChars, string )
	DEF_PROPERTY( multiLine, ubyte )
	
	'slots
	declare STATIC_SLOT(Destroy)
	declare STATIC_SLOT(PaintEvent)
	declare STATIC_SLOT(resizeEvent)
	declare STATIC_SLOT(timerEvent)
	declare STATIC_SLOT(keystrokeEvent)
	declare STATIC_SLOT(clickEvent)
	
	as integer m_cursor
	as integer m_textStartAt
	as integer m_rowStartAt
	as integer m_selection
	as double m_caretInterval
	as double m_caretNextToggle
	as integer m_rowCount
	as stringRow m_strRows(0 To 255)

	declare sub moveCaretLeft()
	declare sub moveCaretRight()
	declare sub countTextRows()
	declare sub moveCaretUp()
	declare sub moveCaretDown()
	
endgclass


end namespace
